package com.doit.demo05;

import java.io.File;

public class test07_file {
    public static void main(String[] args) {
        File file = new File("d:\\work\\abc");
        String[] list = file.list();//文件夹名
        for (String s : list) {
            System.out.println(s);
        }
        File[] files = file.listFiles();//问价夹对象
        for (File file1 : files) {
            System.out.println(file1);
        }
        File[] files1 = File.listRoots();//获得盘符
        for (File file1 : files1) {
            System.out.println(file1);
        }

    }
}
